import os
from common.base import *


# 准备配置项
options = webdriver.ChromeOptions()
# 准备下载路径
download = os.path.abspath('html')
prefs = {'profile.default_content_settings': 0,
         'download.default_drectory': download}
options.add_experimental_option('prefs', prefs)
# 打开浏览器
driver = webdriver.Chrome(options=options)
# 请求网址
driver.get('https://www.selenium.dev/downloads/')
# driver.get('https://guanjia.qq.com/page/product_download.html')
# 定位下载按钮
# driver.find_element(By.LINK_TEXT, '立即下载').click()
driver.find_element(By.LINK_TEXT, '64 bit Windows IE').click()
# 关闭浏览器
sleep(2)
# driver.quit()
